<template>
	<view class="bodi">
		<view class="title">
		    <h1>{{suinfo.biaoti}}</h1>
		</view>
        
        <view class="pd">
            <text>{{suinfo.shenstart}}</text> 
        </view>
        
        <view class="bodies">
            <text>{{suinfo.ztext}}</text> 
            <uni-row >
                <view class="box">
                    <uni-col :span="14">
                    	{{suinfo.faname}}
                    </uni-col>
                    <uni-col :span="10">
                    	{{suinfo.ctime}}
                    </uni-col>
                </view>
            </uni-row>
        </view>
        
     <!--   <view class="tools">
          
        </view> -->
        
        <view class="zffff">
            <uni-row >
                <view class="box1">
                    <uni-col :span="15">
                	<view style="width: 100%;height: 100rpx;">
                	</view>
                    </uni-col>
                    <uni-col :span="3"> 
                       <button open-type="share" style="width: 100%;height: 100%; "> <image src="/static/zf.png" mode="" style="width:100%;height: 30rpx;" /></button>
                    </uni-col>
                    <uni-col :span="3">
                        <view @click="scc"  v-if="scif">
                             <image :src="sc" mode="" style="width: 60%;height: 66rpx;" ></image>
                        </view>
                        <view @click="nscc" v-else>
                              <image  :src="scs" mode="" style="width: 60%;height: 66rpx;" ></image>
                        </view>
                        
                    </uni-col>
                    <uni-col :span="3">
                    	 <view class="" @click="taol(id)">
                    	 	<image src="/static/fk.png" mode="" style="width: 60%;height: 66rpx;"></image>
                    	 </view>
                    </uni-col>
                </view>
            </uni-row>
        </view>
        
	</view>
</template>

<script>
	export default {
		data() {
			return {
				suinfo:{},
                sc:'/static/sc.png',
                scs:'/static/sc1.png',
                scif:true,
                su:{
                    uid:'',
                    history:'',
                    collect:'',
                    htime:''
                }
			}
		},
        onLoad(options){
          this.suinfo=JSON.parse(decodeURIComponent(options.suinfo));
          if(this.suinfo.shenstart=='已辟谣' || this.suinfo.shenstart=='信息真实'){
              uni.showToast({
              	title: '不实信息',
              	icon: 'error',
              	duration: 1000
              })  
          }
          const user = uni.getStorageSync('user');
          this.su.uid=user.id
           this.request('/su/sel/'+this.su.uid+'/'+this.suinfo.id, 'GET').then((res) => {
                console.log(res)
               if(res.data.code==20041){
                   this.scif=false
               }
           })
        },
        onShareAppMessage(res) {
        		    if (res.from === 'button') {
        		      // 来自页面内转发按钮
        		      console.log(res.target)
        		    }
        		    return {
        		      title: '文章内容',
        			  imageUrlId:'uni.png',
        		     // path: `pages/detail/detail?id=${id}` // 分享后打开的页面
        		    }
        		},
		methods: {
            scc(){
                this.su.collect=this.suinfo.id
                this.request("/su/add", 'POST',this.su).then((res) => {
                    this.scif=false
                })
            },
            nscc(){
                this.request('/su/del/'+this.su.uid+'/'+this.suinfo.id, 'GET').then((res) => {
                    this.scif=true
                })
            },
			taol(){
				console.log("-------------");
				console.log(this.suinfo);
				console.log("-----*****------");
				console.log(this.su)
				uni.navigateTo({
				    url: '/pages/index/taol?id='+ this.suinfo.id +'&uid=' + this.su.uid
				});
				
				
			}
		}
	}
</script>

<style>
    button::after{ border: none; }
.box1 {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100px;
  }
.pd{
    width: 30%;
    height: 30px;
    margin:2.5% 2.5% 2.5% 2.5%;
    text-align: center;
    border-radius: 10px;
    float: right;
    border: 2px solid #ff0000;
}
.zffff{
    width: 95%;
    height: 100px;
    margin:2.5% 0 2.5% 2.5%;
    text-align: left;
    border-radius: 10px;

}
.box {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 66px;
  }
.kala_text {
  word-break: break-word;
}
.title{
    font-weight: bolder;
    font-size: 24px;
    width: 95%;
    height: 100%;
    margin:2.5% 0 2.5% 2.5%;
    text-align: left;

}
.bodies{
    line-height: 30px;
    text-indent:10px;
    width: 95%;
    height: 100%;
    margin:20% 0 0 2.5%;
    text-align: left;
    background-color: #dddddd;
     border-radius: 10px;
}
.tools{
    width: 95%;
    height: 66px;
    margin:0 0 2.5% 2.5%;
    text-align: left;
    background-color: #dddddd;
}
.bodi{
   width: 95%;
   height: 100%;
   margin:2.5% 0 2.5% 2.5%;
   text-align: left;
   border-radius: 10px;

}
</style>
